
using System;
using System.Runtime.InteropServices;

namespace ServerHelper
{
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
    public struct SERVERDATA_SHAREDFOLDER
    {

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string id;

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string szPath;
    }


    public enum eFileType
    {

        FileType_Video,

        FileType_Audio,

        FileType_Image,

        FileType_Document,

        FileType_Binary,

        FileType_HTML,
    }

    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
    public struct SERVERDATA_MEDIA
    {

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string id;

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string szPath;

        /// TCHAR[260]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
        public string szName;

        /// int
        public int isFolder;

        /// eFileType
        public eFileType FileType;
    }



    public partial class ServerDataHelper
    {
        /// Return Type: int
        ///xmlbuf: char*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "SetXMLData", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
        public static extern int SetXMLData([System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPArray)] byte[] xmlbuf);

        /// Return Type: int
        ///Count: int*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "GetShareFolderListCount")]
        public static extern int GetShareFolderListCount(ref int Count);


        /// Return Type: int
        ///Index: int
        ///pSharedFolder: SERVERDATA_SHAREDFOLDER*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "GetShareFolderListItem")]
        public static extern int GetShareFolderListItem(int Index, ref SERVERDATA_SHAREDFOLDER pSharedFolder);


        /// Return Type: int
        ///Count: int*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "GetShareItemCount")]
        public static extern int GetShareItemCount(ref int Count);


        /// Return Type: int
        ///Index: int
        ///pMedia: SERVERDATA_MEDIA*
        [System.Runtime.InteropServices.DllImportAttribute("ServerDataHelper.dll", EntryPoint = "GetShareItemInfo")]
        public static extern int GetShareItemInfo(int Index, ref SERVERDATA_MEDIA pMedia);


    }
    public partial class HttpServerHelper
    {

        /// Return Type: void
        [System.Runtime.InteropServices.DllImportAttribute("LibHttpServer.dll", EntryPoint = "StartHomeServer")]
        public static extern void StartHomeServer();


        /// Return Type: void
        [System.Runtime.InteropServices.DllImportAttribute("LibHttpServer.dll", EntryPoint = "StopHomeServer")]
        public static extern void StopHomeServer();
    }
}